package com.twu.biblioteca;

import java.util.List;

public class CentralController {

    public String returnResponse(String input) {
        try {
            List<Option> menuOptions = MenuOptions.getMenuOptions();
            int inputNum = Integer.valueOf(input);
            if (inputNum > menuOptions.size()) {
                return "Select a valid option!!";
            } else {
                return menuOptions.get(inputNum - 1).supplyService();
            }
        } catch (NumberFormatException e) {
            return "Please input a number!!";
        }
    }
}
